package com.tianji.learning.mapper;

import com.tianji.learning.domain.po.LearningLesson;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 学生课程表 Mapper 接口
 * </p>
 *
 * @author yp
 * @since 2023-09-05
 */
public interface LearningLessonMapper extends BaseMapper<LearningLesson> {

    //查询本周计划总数量
    @Select("SELECT SUM(week_freq) FROM learning_lesson WHERE user_id =#{userId} AND plan_status =1 AND `status` IN(0,1,2);")
    Integer selectWeekTotalPlan(@Param("userId") Long userId);
}
